<?php

namespace Sisesporte\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="pre_matricula")
 * @ORM\Entity(repositoryClass="Sisesporte\Repository\PreMatriculaRepository")
 */
class PreMatricula extends UtilsEntity {

    public function __construct($options = null) {
        if (!is_null($options))
            Configurator::configure($this, $options);
    }

    /**
     * @var integer $sqPreMatricula
     * @ORM\Column(name="sq_pre_matricula", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $sqPreMatricula;

    /**
     * @var Sisesporte\Entity\Aluno $sqAluno
     * @ORM\ManyToOne(targetEntity="Sisesporte\Entity\Aluno", inversedBy="sq_pessoa")
     * @ORM\JoinColumn(name="sq_aluno", referencedColumnName="sq_pessoa")
     */
    protected $sqAluno;

    /**
     * @var Sisesporte\Entity\Turma $sqTurma
     * @ORM\ManyToOne(targetEntity="Sisesporte\Entity\Turma", inversedBy="sq_turma")
     * @ORM\JoinColumn(name="sq_turma", referencedColumnName="sq_turma")
     */
    protected $sqTurma;

    /**
     * @var bigint $nuOrdem
     * @ORM\Column(name="nu_ordem", type="bigint", nullable=false)
     */
    protected $nuOrdem;

    /**
     * @var datetime $dtCadastro
     * @ORM\Column(name="dt_cadastro", type="datetime", nullable=true)
     */
    protected $dtCadastro;

    /**
     * @var boolean $stAtivo
     * @ORM\Column(name="st_ativo", type="boolean", nullable=false)
     */
    protected $stAtivo;
    
    /**
     * @var boolean $stSorteio
     * @ORM\Column(name="st_sorteio", type="boolean", nullable=false)
     */
    protected $stSorteio;

    public function getSqPreMatricula() {
        return $this->sqPreMatricula;
    }

    public function getSqAluno() {
        return $this->sqAluno;
    }

    public function setSqAluno(Aluno $sqAluno) {
        $this->sqAluno = $sqAluno;
        return $this;
    }

    public function getSqTurma() {
        return $this->sqTurma;
    }

    public function setSqTurma(Turma $sqTurma) {
        $this->sqTurma = $sqTurma;
        return $this;
    }

    public function getNuOrdem() {
        return $this->nuOrdem;
    }

    public function setNuOrdem($nuOrdem) {
        $this->nuOrdem = $nuOrdem;
        return $this;
    }

    public function getDtCadastro() {
        return $this->formataDateTimeToDate($this->dtCadastro);
    }

    public function setDtCadastro($dtCadastro) {
        $this->dtCadastro = $this->formataDateFromDateTime($dtCadastro);
        return $this;
    }

    public function getStAtivo() {
        return $this->stAtivo;
    }

    public function setStAtivo($stAtivo) {
        $this->stAtivo = $stAtivo;
        return $this;
    }
    
    public function getStSorteio() {
        return $this->stSorteio;
    }

    public function setStSorteio($stSorteio) {
        $this->stSorteio = $stSorteio;
    }

    public function toArray() {
        return array(
            'sqPreMatricula' => $this->getSqPreMatricula(),
            'sqAluno' => $this->getSqAluno(),
            'sqTurma' => $this->getSqTurma(),
            'nuOrdem' => $this->getNuOrdem(),
            'dtCadastro' => $this->getDtCadastro(),
            'stAtivo' => $this->getStAtivo()
        );
    }
}
